//
//  BMSSDK.m
//  BMSSDK
//
//  Created by YeJary on 2025/5/12.
//

#import "BMSNSLog.h"

// Log 开关状态，默认输出log信息
static BOOL Log_Switch = NO;

@interface BMSNSLog()


@end

@implementation BMSNSLog
void CustomBMSLog(const char *func, int lineNumber, NSString *format, ...)
{
    if ([BMSNSLog logEnable]) {
        // 开启了Log
        va_list args;
        
        va_start(args, format);
        
        NSString *string = [[NSString alloc] initWithFormat:format arguments:args];
        
        va_end(args);
        
//        NSString *strFormat = [NSString stringWithFormat:@"%s, Line:%i, Log:%@",func,lineNumber,string];
        
        NSString *strFormat = [NSString stringWithFormat:@"[WDNSLog]:%@",string];
        
#ifdef DEBUG//调试状态，打开LOG功能
        NSLog(@"%@", strFormat);
#else//发布状态，关闭LOG功能
        
#endif
        
        
    }
    
}

+ (BOOL)logEnable {
    
    return Log_Switch;
    
}

+ (void)setLogEnable:(BOOL)flag {
    
    Log_Switch = flag;
    
}

@end
